package model.event;

/**
 * This class represents an Event.
 * An event occurs for example if a user creates an auction, 
 * or if a user logs into the system, and many more.
 *
 * @version 1.0 vom 12.11.2012
 * @author Distributed Group 111 1026312, 1026309
 */

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.UUID;

public abstract class Event implements Serializable {

	private static final long serialVersionUID = 9193273219228452936L;
	private String id;
	protected EventType type;
	private long timestamp;

	public Event(EventType type) {
		this.id = UUID.randomUUID().toString();
		this.type = type;
		this.timestamp = System.currentTimeMillis();
	}

	public EventType getType() {
		return this.type;
	}

	public long getTimestamp() {
		return this.timestamp;
	}

	public String toString() {
		return this.type + ": " + new Timestamp(this.timestamp) + " - ";
	}
}